Skip to content

First commit#1

Open
DivineWind04 wants to merge 27 commits intomainfrom
feature/wr-command-metar
Open

First commit#1
DivineWind04 wants to merge 27 commits intomainfrom
feature/wr-command-metar

Conversation

@DivineWind04
Copy link

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the initial scaffolding for a React + Redux vFDIO client, including auth/login flow, SignalR hub connectivity, terminal-style UI styling, and foundational flightplan-related types/services.

Changes:

  • Added SignalR Hub context/provider plus supporting utils/hooks for connecting, subscribing, and issuing commands.
  • Added Redux store setup with slices (auth/app/sector/mca/customFlightplan) and placeholder thunks.
  • Added initial UI (terminal shell, login page, header/input components) and Tailwind-based styling (including a custom font).

Reviewed changes

Copilot reviewed 40 out of 45 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
src/utils/hubUtils.ts Adds a helper to ensure hub connectivity and invoke hub methods.
src/utils/constants.ts Exposes environment-based runtime constants.
src/types/utility-types.ts Adds Nullable<T> helper type.
src/types/outageEntry.ts Adds OutageEntry model used by app slice.
src/types/hold/holdAnnotations.ts Adds placeholder hold annotation typing.
src/types/apiTypes/index.ts Adds API type barrel + some DTO interfaces.
src/types/apiTypes/eramTypes.ts Adds ERAM message DTOs and enums.
src/types/apiTypes/apiTopic.ts Adds ApiTopic class used for hub subscriptions.
src/types/apiTypes/apiSessionInfoDto.ts Adds session DTO typing used by hub/auth.
src/types/apiTypes/apiFlightplan.ts Adds ApiFlightplan and amend DTO typing.
src/types/aircraftId.ts Adds AircraftId alias.
src/styles/terminal.css Adds Tailwind import, font-face, and theme tokens.
src/styles/fonts/FDIOv2.ttf Adds the FDIO font asset.
src/services/customFlightplanService.ts Adds in-memory flightplan querying/formatting utilities.
src/services/customFlightplanCommandParser.ts Adds a custom command parser (currently malformed/duplicated).
src/redux/thunks/windowThunks.ts Adds placeholder async thunk for window operations.
src/redux/thunks/index.ts Adds placeholder thunks for flightplans/tracks/init.
src/redux/store.ts Configures the Redux store and reducers.
src/redux/slices/sectorSlice.ts Adds sector state slice.
src/redux/slices/mcaSlice.ts Adds MCA/MRA message state slice.
src/redux/slices/customFlightplanSlice.ts Adds serializable flightplan state + selectors.
src/redux/slices/authSlice.ts Adds auth state, login/logout thunks, and config loading.
src/redux/slices/appSlice.ts Adds app slice for FSD connectivity/outage messages.
src/redux/hooks.ts Adds typed Redux hooks.
src/login/Login.tsx Adds login page and VATSIM OAuth redirect flow.
src/index.tsx Adds React app bootstrap.
src/index.html Adds Parcel entry HTML.
src/hooks/useSocketConnector.ts Adds placeholder socket connector hook.
src/hooks/useHubConnector.ts Adds hub context accessor hook.
src/contexts/SocketContext.tsx Adds placeholder socket context/provider.
src/contexts/HubContext.tsx Adds SignalR hub lifecycle management + subscriptions + command sending.
src/components/Recat.tsx Adds RECAT status UI stub.
src/components/InputArea.tsx Adds a command input component (not currently wired into App).
src/components/Header.tsx Adds logout button/header.
src/api/vNasDataApi.ts Adds API functions for login/refresh/config.
src/App.tsx Adds main terminal UI, local command parsing, and routing.
package.json Adds Parcel + React + SignalR + Tailwind dependencies and scripts.
CUSTOM_FLIGHTPLAN_COMMANDS.md Adds documentation for custom flightplan commands.
.postcssrc Configures Tailwind PostCSS plugin.
.gitignore Adds standard ignore patterns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file reads like it was written by AI as a summary of what it did after it completed a coding task.

  • If it is intended as a command reference for end-users, then it should only contain information pertinent to that purpose.
  • If it is intended both for end-users and future developers, then those categories of information should be separated into separate files.

@jlefkoff
Copy link

Please remove the .Zone.Identifier files as these are junk inserted by WSL. You should add a .gitignore entry to prevent these from ending up here.

Copy link

@jlefkoff jlefkoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review all files for bogus/unhelpful AI-inserted one-line comments. There's a lot of them around. Generally try to break >150 line files into separate functions/files for readability/maintainability.

Comment on lines +18 to +26
setFsdIsConnected: (state, action: PayloadAction<boolean>) => {
state.fsdIsConnected = action.payload;
},
addOutageMessage: (state, action: PayloadAction<OutageEntry>) => {
state.outageMessages.push(action.payload);
},
delOutageMessage: (state, action: PayloadAction<string>) => {
state.outageMessages = state.outageMessages.filter(msg => msg.id !== action.payload);
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you display these messages anywhere? If not maybe remove this slice

src/App.tsx Outdated
console.log(` Command: ${command}, Result:`, result);

// Check if result is a REJECT - if so, show ONLY in error area
if (result.toUpperCase().startsWith('REJECT')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make parseCommand return a boolean as part of a more complex type. For example the vNAS server returns this on ERAM messages (note the reject field):

export interface EramMessageProcessingResultDto {
  isSuccess: boolean;
  autoRecall: boolean;
  feedback: string[];
  response: string | null;
}

Comment on lines +1 to +4
export const DOMAIN = process.env.DOMAIN;
export const VATSIM_CLIENT_ID = process.env.VATSIM_CLIENT_ID;
export const VERSION = process.env.VERSION;
export const VNAS_CONFIG_URL = process.env.VNAS_CONFIG_URL; No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe perform a runtime check and quit if they're wrong/unset: https://jsdev.space/howto/env-ts-zod/

@DivineWind04 DivineWind04 self-assigned this Mar 11, 2026
Removes Node.js built-in 'util/types' import that is unavailable in browser
and was unused. This avoids bundling issues and unnecessary polyfills.

Resolves Copilot review comment on App.tsx line 14.
document.getElementById can return null, but ReactDOM.createRoot requires
a non-null container. Add a guard with a clear error message to prevent
a confusing runtime crash if the element is missing.

Resolves Copilot review comment on index.tsx lines 6-7.
holdAnnotations was typed as literal 'null', preventing actual hold annotations
from being represented and making the imported HoldAnnotations type unused.
Changed to Nullable<HoldAnnotations> for proper type support.

Resolves Copilot review comment on apiFlightplan.ts lines 1-29.
…oint

Import was using internal path @microsoft/signalr/dist/esm/HubConnection
which can break with dependency/bundler changes. Changed to the public
@microsoft/signalr entrypoint for upgrade safety.

Resolves Copilot review comment on HubContext.tsx line 30.
Replace placeholder clientVersion '1.3.0' with VERSION constant,
hardcoded eramSectorId 99 with actual position config value,
clientName 'vTDLS' with 'vFDIO', and hardcoded hasEramConfig with
actual position config check.

Resolves Copilot + jlefkoff review comments on HubContext.tsx lines 134-136.
- Remove references to non-existent files (useCustomFlightplanCommands.ts,
  FlightplanVisualization.tsx)
- Remove AI-generated filler sections (Features, Integration, Data Sources,
  Status Display) that don't provide useful reference information
- Rename 'Files Created' to 'Files' since these are existing files
- Keep command reference content that is useful for end-users

Resolves CrazyKidJack + Copilot review comments on CUSTOM_FLIGHTPLAN_COMMANDS.md.
Improves load performance by allowing the browser to show fallback text
while the custom FDIO font loads, preventing invisible text (FOIT).

Resolves Copilot review comment on terminal.css lines 3-6.
Login failure handlers were logging the same message to both toast.error()
and console.log(). Keep only toast.error() (which already calls
console.error internally) to avoid redundant output.

Resolves jlefkoff review comment on authSlice.ts lines 167-168.
vatsimTokenSelector was a zero-arg function reading directly from
localStorage, bypassing Redux state and causing type issues with
useSelector. Changed to proper (state: RootState) => T selector
shape using state.auth.vatsimToken (which is already synced with
localStorage in thunks/reducers).

Resolves Copilot review comment on authSlice.ts lines 209-214.
ensureConnected was returning the original (stale) hubConnection reference
after calling connectHub(), which meant it would always return null when
starting from a null connection. Changed to accept a getter function
() => HubConnection | null so it can retrieve the updated ref after
connectHub() populates it.

Resolves Copilot review comment on hubUtils.ts lines 6-19.
HubContext was created with a non-null default value, making the
null-guard in useHubConnector ineffective (useContext would never
return falsy). Changed createContext default to null so the runtime
check in useHubConnector properly detects missing Provider.

Resolves Copilot review comment on useHubConnector.ts lines 6-10.
EramTrackDto, ApiAircraftTrack interfaces and updateTrackThunk,
deleteTrackThunk were placeholder stubs with no subscribers to track
topics. Also removed placeholder console.log statements and AI-generated
comments from remaining thunks.

Resolves jlefkoff review comment on apiTypes/index.ts lines 3-13.
These are junk files inserted by WSL that should never be committed.
Added *Zone.Identifier pattern to .gitignore to prevent future occurrences.

Resolves jlefkoff review comment about .Zone.Identifier files.
- Delete windowThunks.ts (no window system implemented)
- Delete SocketContext.tsx (empty stub, not doing shared-state)
- Delete useSocketConnector.ts (console.log-only stub)
- Remove all imports and usages from HubContext.tsx

Resolves jlefkoff review comments on windowThunks.ts and SocketContext.tsx.
Fail fast with a clear error listing any missing env vars instead of
silently running with undefined values that cause confusing errors later.

Resolves jlefkoff review comment on constants.ts lines 1-4.
Every line in the file was duplicated on the same line (e.g.,
'import X;import X;'). Deduplicated all lines and cleaned up
extra blank lines that were artifacts of the corruption.

Resolves jlefkoff review comment on customFlightplanCommandParser.ts.
Remove placeholder comments like 'Simple toast for now', 'Add properties
as needed', 'For development, use alert', 'end blinking cursor section',
and aspirational TODO comments that don't add value.

Keep domain-specific comments that explain ERAM formatting and column
positions since those provide genuine documentation value.

Resolves jlefkoff review comment to remove bogus AI-inserted comments.
Extract duplicated strip formatting logic from App.tsx ReceiveStripItems
handler and SR command into a shared formatStripFromFieldValues function
in src/utils/stripFormatter.ts.
Move parseCommand function and all command handlers (FP, AM, GI, WR, SR,
FR, RS) from App.tsx into src/services/commandParser.ts as individual
functions. App.tsx now imports parseCommand and passes a CommandContext
object with all required dependencies. Follows EDST frontend pattern of
dedicated handler functions per command type.
Remove sendEramMessage from HubContext public API and merge its logic
into sendCommand. Remove ProcessEramMessageDto, EramMessageProcessingResultDto,
and EramPositionType imports. Delete src/types/apiTypes/eramTypes.ts (done in
previous commit). Hub message now uses inline object literal instead of typed DTO.
@@ -0,0 +1,9 @@
<html>
<head>
<title>Minimal React application</title>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<title>Minimal React application</title>
<title>vFDIO</title>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants